#include<bits/stdc++.h>
#define N 50000
using namespace std;
long long sum=0;
int main()
{
    for(long long i=0;i<N;i++)
        for(long long j=0;j<N;j++)
            if((i+1)*(i+1)+(j+1)*(j+1)<=(long long)N*N)
                sum++;
    sum*=4;
    cout<<sum<<endl;
    return 0;
}
